home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
133_01
/
e.doc
< prev
next >
Wrap
Text File
|
1980-01-01
|
51KB
|
1,261 lines
The e screen editor Page 1
eeeee
ee ee
ee ee
eeeeeeeeeee
ee
ee
eeeeeeeee
TUTORIAL GUIDE AND IMPLEMENTATION MANUAL
The e screen editor is full-screen editor designed for creating and
modifying the source text of programs. It is not, and it is not intended to
be, a word processor.
It is released through the C Users Group for private non-profitmaking use by
G. Nigel Gilbert
MICROLOGY
Version 4.8 October 1984
The e screen editor Page 2
Contents
1. Prerequisites
2. Introduction
3. Development history
4. Why e was written
5. How e works
6. Using e
7. Implementing e on your terminal
8. Changing the default settings of the options
9. Compiling and loading e
1. Prerequisites
The editor is written in the programming language C and the source code is
available in the public domain for non-profit use. It is recommended that
you also have to hand a copy of the BDS C compiler, version 1.50 or later,
if you need to reconfigure the editor to suit your terminal and your choice
of default option settings.
The editor can be configured simply to run under CP/M with any moderately
sophisticated terminal. The following screen control functions must be
available with the terminal: clear to end of line, clear to end of page,
line insert, and line delete. It is probably not worth using or adapting e
to run on terminals that do not support these functions (among the terminals
which DO support these functions are: the TVI 910, 912, 920, 925, 950
series, Hazeltine 1420, 1500, Executive and Esprit series, ADM-31 (but not
the ADM-3a), DEC VT52 and VT100, ADDS range, Visual 50 and 55 and other
terminals which offer emulations of these).
Also required is CP/M, version 2, or CP/M 3.1 (CP/M Plus), and at least 48K
(and preferably 56K) of RAM. Other versions of CP/M might well do.
2. Introduction
This document has sections on:
the 'philosophy' of e - why it was written to work the way it does
(sections 3, 4 and 5)
using e (section 6)
implementing e (sections 7, 8, and 9)
The e screen editor Page 3
3. Development history
e was written over a period of about two years to satisfy my own need for a
decent screen editor to use for programming, primarily in C, but also in
FORTRAN and Pascal. During that time, it has developed and changed. I
expect that it will continue to do so, and hope that other users will keep
in contact with me about what they think of it, what changes they make to it
and how it could be improved.
I can be contacted at:
G. Nigel Gilbert
MICROLOGY
4 Deanery Road
Godalming GU7 2PQ
Surrey
England
4. Why e was written
The design of e was determined largely by my own specific needs. I already
possessed a copy of WordStar, the well-known, massive and generally
excellent word processing package. I also possessed a copy of the well-
known and entirely excellent BDS C compiler. Unfortunately, the two do not
mesh well together. In practice, programming in C (or in any other compiled
language) requires one to edit a program file, run the file through the
compiler, locate errors, then re-edit the file to make corrections, and
repeat all this a large number of times. The faster the cycle can proceed,
the faster is program development. However, because WordStar is a big and
powerful package, with two overlays to read off disk into memory, it can
take over 25 seconds from the moment the command line is typed to being able
to edit the program text. Moreover, the C compiler, like many others,
reports syntax errors by line number; WordStar has no command to move the
cursor to a specified line number. All in all, WordStar is great for text,
and not much good for programs.
I resolved, therefore, to write an editor more adapted to my needs. Such an
editor would have the following characteristics (in rough order of
priority):
Small run file, with no overlays
No initial menu - one would go straight into editing the text
A command to jump to a given line number
Random access to the text; as far as possible, it should be as quick to
move from line 500 to line 1 as from line 1 to line 500
As few 'modes' as possible - I don't like editors (such as, for instance
the UCSD editor) where one can only insert in the 'insert' mode, and
only delete in the 'delete' mode
No (unreasonable) limit on the size of files which can be edited
As crash proof as possible - including guards against BDOS errors and
disk and directory full errors
Auto-indent feature for structured programming languages
Capability of listing selcted portions of programs to the printer,
whilst remaining inside the editor
The e screen editor Page 4
e does all of these. On the other hand, there are a number of facilities
which other editors possess, but which e does not have. They are all
features which, if implemented, would conflict with one or more of the above
'desirables'. An editors is the kind of the thing for which personal
preferences are important and varied, and thus your favorite feature may be
in the list below, rather than the list above. If so, you can always have a
go implementing it. (If you do, I'd be glad to have a copy, and so probably
would the User Group).
Macros and multiple commands executed repeatedly (in my view, these are
more appropriate to a batch, rather than an interactive editor; and,
anyway, such commands are difficult to formulate so that they do
exactly what is wanted and neither more nor less)
Wild characters and regular expressions in defining search strings for
the Find and Alter commands (possible to implement, but would reduce
the searching speed significantly)
An 'Overwrite' mode as well as an 'Insert' mode (see comments above
about modes)
Word processing capabilities, such as word wrap and re-formating (I use
WordStar)
Block moves of arbitrary blocks, rather than just blocks of complete
lines (fine, but the coding is hair-raising)
At one time or another, I've tried all these latter features, but eventually
given up or thrown them out as unnecessary or unproductive.
The e screen editor Page 5
5. How e works
The above list of desirables more or less dictated the basic design
principles of e. For instance, the need to get to a particular line
suggested that the text being edited should be organised in lines (as
opposed to a continuous block of text, including end-of-line markers). The
former organisation is that adopted by e (and by EDIT-80); the latter by
ED and WordStar. The choice has a profound impact on the style of the
resulting editor.
Since text lines are